FROM ubuntu:16.04

USER root

COPY ./sources.list /etc/apt/sources.list
RUN apt-get update && apt-get install -yqq nginx && apt-get install -y curl wget git

RUN wget -qO- https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update && apt-get install -y nodejs
RUN npm install -g cnpm --registry=https://registry.npm.taobao.org
# 复制项目代码
COPY . /src
WORKDIR /src

RUN cnpm i

RUN npm run build:test

COPY nginx.conf /etc/nginx/nginx.conf

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
